#pragma once
#ifndef MULTISNAKE_H
#define MULTISNAKE_H
#include <QWidget>
#include <qqueue.h>
#include <qset.h>
#include "../Snake/Snake.h"
#include <QKeyEvent>

class Player {
public:
	~Player() {};
	QQueue<QPoint>* player = new QQueue<QPoint>();
	bool die = false;
	Direction direct, newDirect;
};

class MultiSnake : public Snake
{
	Q_OBJECT;
public:
	MultiSnake(QWidget* parent, int cellNum, int cellLen);
	~MultiSnake();
	void keyEvent(QKeyEvent* event);
	void init() override;

protected:
	void initOtherPlayers();
	void doGameLogic();
	void doKeyEvent();
	virtual void updateOtherPlayers();
private:
	QSet<Player*>* otherSnakes = new QSet<Player*>();
};


bool operator==(const Player& left_card, const Player& right_card);

uint qHash(const Player& card);

#endif MULTISNAKE_H

